{
	name:"Foldline",
	importCommand:[{
		key:"{CN}",
		path:"./config"
	},{
		key:"Tool",
		path:"./paint_tool/lines/foldline.shape"
	}],
	onInit(){
		this.ctrlIndex = -1
	},
	onFocusIn(){
		this.longToast("请连续点击多个点，并点击其中某个点结束")
	},
	onClick(pos,e,meta){
		pos = this.newPoint(pos,this.step.length)
		let iscs = this.isInCurrentStep(pos)
		if(iscs){
			this.step.push(iscs.assign())
			this.commit()
		}else{
			this.step.push(pos)
			this.point(pos)
		}
	},
	onMousemove(pos){
		if(this.step.length>0){
			let iscs = this.isInCurrentStep(pos)
			this.togglePointer(iscs)
			this.refresh(pos)
		}
	},
	isInCurrentStep(pos){
		return this.step.filter(p=>Math.distance(p,pos)<p.r)[0]
	},
	getLineMeta(stepData,pos){
		return Math.getLineMeta(stepData.step,pos)
	}
}